<script lang="ts" setup>
import type { ViewItem } from "../types/home";
// 工具函数库
import { getCurrency } from "../utils/utils";
// import '../utils/WatfulFull'
// ts 里比js复杂
// 数据
interface Props {
  items: ViewItem[];
}
defineProps<Props>();
//  ---------------------------------------------------------------------
</script>
<template>
  <div
    class="item-wrapper relative overflow-auto bg-slate-50 relative rounded-xl"
  >
    <div
      class="item space-y-2 mb-1 mx-1 float-left w-40 bg-white h-80"
      v-for="item in items"
      :key="item.name"
    >
      <div class="item-image h-60">
        <img :src="item.cover" class="rounded w-40 h-full" />
      </div>
      <div class="item-info m-1">
        <div class="item-name text-xs font-bold">{{ item.name }}</div>
        <div class="item-price text-xs font-bold">
          {{ getCurrency(item.price) }}
        </div>
      </div>
    </div>
  </div>
</template>
